namespace CollabApp.API.DTOs.Room;

/// <summary>
/// 创建房间请求DTO
/// </summary>
public class CreateRoomRequest
{
    /// <summary>
    /// 房间名称
    /// </summary>
    public string RoomName { get; set; } = string.Empty;

    /// <summary>
    /// 房间密码（可选）
    /// </summary>
    public string? Password { get; set; }

    /// <summary>
    /// 最大玩家数（2-8人）
    /// </summary>
    public int MaxPlayers { get; set; } = 6;

    /// <summary>
    /// 游戏模式
    /// </summary>
    public string GameMode { get; set; } = "classic";

    /// <summary>
    /// 是否为私人房间
    /// </summary>
    public bool IsPrivate { get; set; } = false;

    /// <summary>
    /// 地图大小
    /// </summary>
    public int MapSize { get; set; } = 1000;

    /// <summary>
    /// 游戏时长（秒）
    /// </summary>
    public int GameDuration { get; set; } = 180;
}

/// <summary>
/// 加入房间请求DTO
/// </summary>
public class JoinRoomRequest
{
    /// <summary>
    /// 房间密码（如果房间需要密码）
    /// </summary>
    public string? Password { get; set; }
}

/// <summary>
/// 更新房间设置请求DTO
/// </summary>
public class UpdateRoomSettingsRequest
{
    /// <summary>
    /// 房间名称
    /// </summary>
    public string? RoomName { get; set; }

    /// <summary>
    /// 房间密码
    /// </summary>
    public string? Password { get; set; }

    /// <summary>
    /// 最大玩家数
    /// </summary>
    public int? MaxPlayers { get; set; }

    /// <summary>
    /// 游戏模式
    /// </summary>
    public string? GameMode { get; set; }

    /// <summary>
    /// 地图大小
    /// </summary>
    public int? MapSize { get; set; }

    /// <summary>
    /// 游戏时长
    /// </summary>
    public int? GameDuration { get; set; }

/// <summary>
/// 是否为私人房间
/// </summary>
public bool? IsPrivate { get; set; }
}

/// <summary>
/// 踢出玩家请求DTO
/// </summary>
public class KickPlayerRequest
{
    /// <summary>
    /// 要踢出的玩家ID
    /// </summary>
    public string PlayerId { get; set; } = string.Empty;
}

/// <summary>
/// 切换准备状态请求DTO
/// </summary>
public class ToggleReadyRequest
{
    /// <summary>
    /// 准备状态（true=准备，false=取消准备）
    /// </summary>
    public bool IsReady { get; set; }
}

/// <summary>
/// 发送聊天消息请求DTO
/// </summary>
public class SendChatMessageRequest
{
    /// <summary>
    /// 消息内容
    /// </summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>
    /// 消息类型（text=文本，system=系统消息）
    /// </summary>
    public string MessageType { get; set; } = "text";
}

/// <summary>
/// 聊天消息响应DTO
/// </summary>
public class ChatMessageResponse
{
    /// <summary>
    /// 消息ID
    /// </summary>
    public int Id { get; set; }

    /// <summary>
    /// 发送者用户名
    /// </summary>
    public string Username { get; set; } = string.Empty;

    /// <summary>
    /// 消息内容
    /// </summary>
    public string Message { get; set; } = string.Empty;

    /// <summary>
    /// 消息类型
    /// </summary>
    public string MessageType { get; set; } = string.Empty;

    /// <summary>
    /// 发送时间
    /// </summary>
    public DateTime CreatedAt { get; set; }
}
